package com.bingbing.bingbingmall.order.controller;

import com.bingbing.bingbingmall.order.entity.OrderEntity;
import com.bingbing.bingbingmall.order.service.OrderService;
import com.bingbing.common.utils.PageUtils;
import com.bingbing.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;


/**
 * 订单
 *
 * @author bingbing
 * @email sunlightcs@bingbingmall.com
 * @date 2022-03-12 18:49:56
 */
@RestController
@RequestMapping("order/order1")
public class CancelOrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/cancelOrder/{orderSn}")
    public String cancelOrder(@PathVariable("orderSn") String orderSn){

        String cancelMsg  = orderService.cancelOrder(orderSn);
        return cancelMsg;
    }

    @GetMapping("/affirmOrder/{orderSn}")
    public String affirmOrder(@PathVariable("orderSn") String orderSn){

        String cancelMsg  = orderService.affirmOrder(orderSn);
        return cancelMsg;
    }

    @GetMapping("/applyOrder/{orderSn}")
    public String applyOrder(@PathVariable("orderSn") String orderSn){

        String cancelMsg  = orderService.applyOrder(orderSn);
        return cancelMsg;
    }

    @GetMapping("/accomplishOrder/{orderSn}")
    public String accomplishOrder(@PathVariable("orderSn") String orderSn){

        String cancelMsg  = orderService.accomplishOrder(orderSn);
        return cancelMsg;
    }


}
